//生成用户付款码
$("#paycode").qrcode({ 
    render: "table", //table方式 
    width: 230, //宽度 
    height:230, //高度
    colorDark : "#ffffff",       //二维码的后景色
    colorLight : "#000000",        //二维码的前景色
    text: "暂未启用移动端"	//内容
}); 


//生成用户支付费用
$("#eval").click(function () {
    $.ajax({
        type: "post",
        url: "/S.F.System/member/pay",
        dataType: "json",
        data: {//上传参数
            weight: $("#weight").val(),
            type: $("#type").val()
        },
        
        success: function (data) {
        	$("#paycount").html(data.pay);
        	$("#payvalue").val(data.pay);
        },
        error: function (jqObj) {
        	alert("未完成支付！");
        }
    });
});


/*弹出页面的关闭按钮*/
function closeBox() {
    var popBox = document.getElementById("popBox");
    var popLayer = document.getElementById("popLayer");
    popBox.style.display = "none";
    popLayer.style.display = "none";
}


//用户登录状态检查
function checkmember() {
	var message=null;
    $.ajax({
        url: "/S.F.System/member/checkuser",
        dataType: "json",
        async: false,
        success: function (data) {
        	message=data.checkusermessage;
        }
    });
    if(message=="logined"){
    	return true;
	}else {
		var popBox = document.getElementById("popBox");
        var popLayer = document.getElementById("popLayer");
        popBox.style.display = "block";
        popLayer.style.display = "block";
        $("#warningmessage").html(message);
        return false;	
        }
}


//用户登录信息检查
function checklogin() {
	var message=null;
	$.ajax({
        type: "post",
        url: "/S.F.System/member/login",
        dataType: "json",
        data: {//上传参数
            name: $("#name").val(),
            password: $("#password").val()
        },
        async: false,
        success: function (data) {
        	message=data.checkloginmessage;
        },
        error: function (jqObj) {
        	alert("失败！");
        }
    });
    if(message=="loginsuccess" || message=="registersuccess"){
    	return true;
	}else {
		var popBox = document.getElementById("popBox");
        var popLayer = document.getElementById("popLayer");
        popBox.style.display = "block";
        popLayer.style.display = "block";
        $("#warningmessage").html(message);
        return false;
	}
}

//快递信息检查
function checkbagid() {
	var message=null;
	$.ajax({
        type: "post",
        url: "/S.F.System/member/confirmId",
        dataType: "json",
        data: {//上传参数
        	trackcode: $("#trackcode").val()
        },
        async: false,
        success: function (data) {
        	message=data.checkbagid;
        },
        error: function (jqObj) {
        	alert("失败！");
        }
    });
    if(message=="success"){
    	return true;
	}else {
		var popBox = document.getElementById("popBox");
        var popLayer = document.getElementById("popLayer");
        popBox.style.display = "block";
        popLayer.style.display = "block";
        $("#warningmessage").html(message);
        return false;	}
}

//管理员登录信息检查
function checkbackstagelogin() {
	var message=null;
	$.ajax({
        type: "post",
        url: "/S.F.System/backstage/check",
        dataType: "json",
        data: {//上传参数
            name: $("#name").val(),
            password: $("#password").val()
        },
        async: false,
        success: function (data) {
        	message=data.checkloginmessage;
        },
        error: function (jqObj) {
        	alert("失败！");
        }
    });
    if(message=="loginsuccess"){
    	return true;
	}else {
		var popBox = document.getElementById("popBox");
        var popLayer = document.getElementById("popLayer");
        popBox.style.display = "block";
        popLayer.style.display = "block";
        $("#warningmessage").html(message);
        return false;
	}
}

//快递信息更新检查
function checkupdateparcel() {
	var message=null;
	$.ajax({
        type: "post",
        url: "/S.F.System/member/checkmember",
        dataType: "json",
        data: {//上传参数
        	membername: $("#membername").val()
        },
        async: false,
        success: function (data) {
        	message=data.checkupdateparcel;
        },
        error: function (jqObj) {
        	alert("失败！");
        }
    });
    if(message=="success"){
    	return true;
	}else {
		var popBox = document.getElementById("popBox");
        var popLayer = document.getElementById("popLayer");
        popBox.style.display = "block";
        popLayer.style.display = "block";
        $("#warningmessage").html(message);
        return false;	}
}
